import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import { createPinia } from 'pinia'
import { $gotoUrl } from './utils/utils'
import NavBar from '@/components/NavBar';
import upLoadingPage from "@/uni_modules/uview-plus/components/u-loading-page/u-loading-page.vue";
import upEmpty from "@/uni_modules/uview-plus/components/u-empty/u-empty.vue";
export function createApp () {
  const app = createSSRApp(App)
  //注册全局
  app.config.globalProperties.$gotoUrl = $gotoUrl;
  //注册pinia
  const pinia = createPinia()

  app.use(pinia)
  //注册公共组件
  app.component('NavBar', NavBar)
  app.component("upLoading", upLoadingPage)
  app.component("upEmpty", upEmpty)
  return {
    app
  }
}
// #endif